<?php include _include(APP_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-12 mx-auto">
		<ol class="breadcrumb d-none d-md-flex">
			<li class="breadcrumb-item"><a href="./" aria-label="<?php echo lang('index_page');?>"><i class="icon-home"></i></a></li>
			<li class="breadcrumb-item"><a href="<?php echo url("forum-$fid");?>"><?php echo $forum['name'];?></a></li>
			<li class="breadcrumb-item active"><a href="<?php echo url("thread-$tid");?>" title="<?php echo lang('index_page');?>返回主题第一页"><?php echo $thread['subject'];?></a></li>
			<li class="breadcrumb-item active">编辑版本比较</li>
		</ol>
		<table class="table table-bordered bg-white">
			<thead>
				<tr>
					<th scope="col" width="50%">当前版本</th>
					<th scope="col"><?php echo $log['create_date_fmt'];?> 版本</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td><?php echo $post['message_fmt'];?></td>
					<td><?php echo $log['message'];?></td>
				</tr>
			</tbody>
		</table>
		
		<a role="button" class="btn btn-secondary btn-block xn-back col-lg-6 mx-auto mb-3" href="javascript:history.back();"><?php echo lang('back');?></a>
		
	</div>
</div>

<?php include _include(APP_PATH.'view/htm/footer.inc.htm');?>

<script>

$('#nav li[fid="<?php echo $fid;?>"]').addClass('active');

/*
var s1 = 'create a SequenceMatcher \r\n	\r\n instance that diffs the two sets of lines';
var s2 = 'create a SequenceMatcher \r\n	 \r\n instance that diffs the three sets of lines yes.';

var TextDiff = function(left_str, right_str, result_div) {
	// 首先按照行切分
	this.j = 0; // 工作进度，逐行扫描
	this.result_div = result_div;
	
	this.left_str = xn.str_replace("\r\n", "\n", left_str);
	this.right_str = xn.str_replace("\r\n", "\n", right_str);
	this.left_lines = xn.explode("\n", this.left_str);
	this.right_lines = xn.explode("\n", this.right_str);
}

// 发现右侧内容近似的行
TextDiff.prototype.find_right = function() {
	
}

// 判断是否大致相等
TextDiff.prototype.is_equal = function(left, right, i, j) {
	var left_words = xn.explode(' ', left_line);
	var right_words = xn.explode(' ', right_line);
}

// 开始扫描
TextDiff.prototype.scan = function() {
	var left_line_status = []; // deleted|modified
	var right_line_status = []; // new|modified
	var left_word_status = []; // deleted|modified
	var right_word_status = []; // new|modified
	var i = 0;
	for(var i=0; i<this.left_lines.length; i++, this.j++) {
		var left_line = this.left_lines[i];
		var right_line = this.right_lines[this.j];
		if(this.is_equal(left_line, right_line, i, this.j)) {
			left_line_status[i] = 'equal';
			left_line_status[i] = 'equal';
		} else {
			// 右侧向下扫描，从第 work_line 开始；
			while(this.j++ < right_lines.length) {
				
			}
			
		}
		line_status[k] = ''; // new|modified|deleted
		
	});
	// 结果输出到
}

// 比较的结果在指定的区域显示
var diff = new TextDiff(s1, s2, 'post_update_log_view');
diff.scan();
*/

</script>


